package uesr;

import operation.action.Goods_Operation;
import operation.action.InputCar;
import operation.user.*;

import java.util.Random;
import java.util.Scanner;

public class Customer extends User{
    public int balance;// 余额

    public Customer () {
        goods_operations = new Goods_Operation[] {
                new InputCar()
        };
        user_operations = new User_Operation[] {
                new Register(),
                new Login(),
                new Menu(),
                new Exit()
        };
    }



    public void register() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的昵称");
        String name = scanner.next();
        System.out.println("请输入你的密码");
        int password = scanner.nextInt();
        this.name = name;
        this.password = password;
        Random random = new Random();

        int account = random.nextInt(100_000_000);
        System.out.println("注册成功,请保存好账号密码," + name);
        System.out.println("账号 " + account);
        System.out.println("密码 " + password);

    }

    @Override
    public int goods_menu() {
        System.out.println("加入购物车");
        return 0;
    }


}
